EPD Extension Kit for MSP430 LaunchPad
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
EPD_hardware_gpio.h
Go to the documentation of this file.
1 
35 
36 #ifndef DISPLAY_HARDWARE_GPIO_H_INCLUDED
37 #define DISPLAY_HARDWARE_GPIO_H_INCLUDED
38 
39 #define _BV(bit) (1 << (bit))
40 #define _HIGH 1
41 #define _LOW !_HIGH
43 //FOR MSP430
44 #define DIR_(x) x ## DIR
45 #define DIR(x) (DIR_(x))
46 #define OUT_(x) x ## OUT
47 #define OUTPORT(x) (OUT_(x))
48 #define SEL_(x) x ## SEL
49 #define SEL(x) (SEL_(x))
50 #define SEL2_(x) x ## SEL2
51 #define SEL2(x) (SEL2_(x))
52 #define IN_(x) x ## IN
53 #define INPORT(x) (IN_(x))
54 #define REN_(x) x ## REN
55 #define REN(x) (REN_(x))
56 #define BITSET(x,y) ((x) |= (y))
57 #define BITCLR(x,y) ((x) &= ~(y))
58 #define BITINV(x,y) ((x) ^= (y))
59 
60 #define config_gpio_dir_o(Port,Pin) BITSET(DIR (Port), Pin)
61 #define config_gpio_dir_i(Port,Pin) BITCLR(DIR (Port), Pin)
62 #define set_gpio_high(Port,Pin) BITSET (OUTPORT (Port), Pin)
63 #define set_gpio_low(Port,Pin) BITCLR (OUTPORT (Port), Pin)
64 #define set_gpio_invert(Port,Pin) BITINV(OUTPORT (Port),Pin)
65 #define input_get(Port,Pin) (INPORT (Port) & Pin )
67 /******************************************************************************
68 * GPIO Defines
69 *****************************************************************************/
70 #define Temper_PIN BIT4
71 #define Temper_PORT P1
72 #define SPICLK_PIN BIT5
73 #define SPICLK_PORT P1
74 #define EPD_BUSY_PIN BIT0
75 #define EPD_BUSY_PORT P2
76 #define PWM_PIN BIT1
77 #define PWM_PORT P2
78 #define EPD_RST_PIN BIT2
79 #define EPD_RST_PORT P2
80 #define EPD_PANELON_PIN BIT3
81 #define EPD_PANELON_PORT P2
82 #define EPD_DISCHARGE_PIN BIT4
83 #define EPD_DISCHARGE_PORT P2
84 #define EPD_BORDER_PIN BIT5
85 #define EPD_BORDER_PORT P2
86 #define SPIMISO_PIN BIT6
87 #define SPIMISO_PORT P1
88 #define SPIMOSI_PIN BIT7
89 #define SPIMOSI_PORT P1
90 #define Flash_CS_PIN BIT7
91 #define Flash_CS_PORT P2
92 #define Flash_CS_PORT_SEL (SEL (Flash_CS_PORT))
93 #define Flash_CS_PORT_SEL2 (SEL2(Flash_CS_PORT))
94 #define EPD_CS_PIN BIT6
95 #define EPD_CS_PORT P2
96 #define CS_PORT_SEL (SEL (EPD_CS_PORT))
97 #define CS_PORT_SEL2 (SEL2(EPD_CS_PORT))
98 
99 bool EPD_IsBusy(void);
100 void EPD_cs_high (void);
101 void EPD_cs_low (void);
102 void EPD_flash_cs_high(void);
103 void EPD_flash_cs_low (void);
104 void EPD_rst_high (void);
105 void EPD_rst_low (void);
106 void EPD_discharge_high (void);
107 void EPD_discharge_low (void);
108 void EPD_Vcc_turn_off (void);
109 void EPD_Vcc_turn_on (void);
110 void EPD_border_high(void);
111 void EPD_border_low (void);
112 void EPD_pwm_low (void);
113 void EPD_pwm_high(void);
114 void SPIMISO_low(void);
115 void SPIMOSI_low(void);
116 void SPICLK_low(void);
117 void EPD_initialize_gpio(void);
118 
119 #endif //DISPLAY_HARDWARE_GPIO_H_INCLUDED
120 
121